package com.yykj.tencent.oss.controller;

import com.yykj.common.dto.StsDTO;
import com.yykj.common.enums.ResultEnums;
import com.yykj.common.vo.ResultVO;
import com.yykj.tencent.oss.service.TencentCosService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.*;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

@RestController
@RequestMapping("/tencent/cos")
@Api(tags = {"腾讯云OSS"})
@SuppressWarnings("unchecked")
public class CosController {
    @GetMapping("/sts")
    @ApiOperation(value = "获取临时授权sts", notes = "参考：https://cloud.tencent.com/document/product/436/14048")
    public ResultVO<StsDTO> getSts() {
        return ResultVO.success(service.sts());
    }

    private TencentCosService service;

    @Autowired
    public void setService(TencentCosService service) {
        this.service = service;
    }
}
